Technical Q&A QA1228
The Rendezvous Name is not the Rendezvous name


Q: When I advertise my service with Rendezvous, I use SCDynamicStoreCopyLocalHostName which retrieves the "Rendezvous Name" from the Sharing preference panel, and then I pass in that name when registering. Is that the correct thing to do?

A: No. You should not advertise your service using the "Rendezvous Name" from the Sharing preference panel. The "Rendezvous Name" is actually your link-local hostname, so it must conform to the standard naming conventions of DNS hostnames. That means it's restricted to letters, digits and hyphens, so it's not very user-friendly. In order to alleviate confusion associated with the term "Rendezvous Name", the text label "Rendezvous Name" in the Sharing preference panel was renamed to "Local Hostname" in Mac OS X 10.3.

The "Local Hostname" is very useful when managing a home network. For example, if you need to SSH into a machine on your local subnet, in the past you would have to remember its IP address, but with DHCP, the IP address is constantly changing. If you set the computer's "Local Hostname" to be "powermac", you could open the Terminal and type "ssh powermac.local." in order to SSH into it without ever needing to know its IP address.

A Rendezvous service name may contain any characters without restriction, including spaces, punctuation, accented characters, non-Roman text, and anything else that may be represented using UTF-8. Therefore, it probably doesn't make sense to advertise a service using the "Local Hostname", with its restricted character set. In most situations, you should advertise your service using the "Computer Name" from the Sharing preference panel, although you're free to advertise a service using whatever name you choose.

It's easy to register a service with the "Computer Name" when using CFNetServices, NSNetServices, or DNSServiceDiscovery. Simply pass in an empty string ("") for the name, and the system will automatically advertise your service using the "Computer Name", and will automatically handle name conflicts by appending a digit to the end of the name.


[Mar 5, 2004]


Developer Documentation | Technical Notes | Development Kits | Sample Code